<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      height: 100vh;
      background-color: black;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: black;
      text-align: center;
    }

    .box {
      width: 150px;
      height: 100px;
      margin: 20px;
      background: white;
    }

    .box:nth-child(1) {
      transform: skewX(-45deg);
    }

    .box:nth-child(1) > .inner {
      transform: skewX(45deg);
      height: 100%;
    }

    .box:nth-child(3),
    .box:nth-child(4),
    .box:nth-child(2) {
      position: relative;
    }

    .box:nth-child(3)::before,
    .box:nth-child(2) .left {
      position: absolute;
      left: -100px;
      width: 0;
      height: 0;
      /* border: 5px solid red; */
      border-style: solid;
      border-width: 0;
      border-top-width: 100px;
      border-right-width: 100px;
      border-right-color: white;
    }

    .box:nth-child(3)::after,
    .box:nth-child(2) .right {
      position: absolute;
      right: -100px;
      width: 0;
      height: 0;
      /* border: 5px solid red; */
      border-style: solid;
      border-width: 0;
      border-top-width: 100px;
      border-right-width: 100px;
      border-top-color: white;
    }

    .box:nth-child(3)::after,
    .box:nth-child(3)::before {
      content: '';
    }

    .box:nth-child(4)::before {
      position: absolute;
      content: '';
      left: 0%;
      right: 0%;
      top: 0;
      bottom: 0;
      background: red;
      z-index: -1;
      transform: skewX(-45deg);
    }

    .box:nth-child(5) {
      clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);
      line-height: 100px;
      transition: clip-path .5s ease-in;
    }

    .box:nth-child(5):hover {
      clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="inner">
      transform: skewX(-45deg);
    </div>
  </div>
  <div class="box">
    <div class="left"></div>
    <div class="right"></div>
  </div>
  <div class="box">
    <div class="left"></div>
    <div class="right"></div>
  </div>
  <div class="box"></div>
  <div class="box">
    hello world
  </div>
</body>
</html>